package io.renren.modules.generator.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.generator.dao.EnterpriseEnvproMonitorDao;
import io.renren.modules.generator.entity.EnterpriseEnvproMonitorEntity;
import io.renren.modules.generator.service.EnterpriseEnvproMonitorService;


@Service("enterpriseEnvproMonitorService")
public class EnterpriseEnvproMonitorServiceImpl extends ServiceImpl<EnterpriseEnvproMonitorDao, EnterpriseEnvproMonitorEntity> implements EnterpriseEnvproMonitorService {

    @Autowired
    private EnterpriseEnvproMonitorDao enterpriseEnvproMonitorDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {

        IPage<EnterpriseEnvproMonitorEntity> page = this.page(
                new Query<EnterpriseEnvproMonitorEntity>().getPage(params),
                new QueryWrapper<EnterpriseEnvproMonitorEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<EnterpriseEnvproMonitorEntity> selectList(EnterpriseEnvproMonitorEntity enterpriseEnvproMonitorEntity) {
        QueryWrapper<EnterpriseEnvproMonitorEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(EnterpriseEnvproMonitorEntity::getEnterpriseId,enterpriseEnvproMonitorEntity.getEnterpriseId());
        return enterpriseEnvproMonitorDao.selectList(queryWrapper);
    }

}